package cn.wolfcode.crm.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Getter@Setter
public class OrderBill {

    private Long id;

    public static final Integer NORMAL = 1;//未审核状态
    public static final Integer AUDIT = 2; //已审核状态

    private String sn; //采购编号
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date vdate; //业务时间
    private Integer status = NORMAL; //单据状态
    private BigDecimal totalAmount;//采购总额
    private BigDecimal totalNumber; //采购总数
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date auditTime;//审核时间
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date inputTime;//录入时间

    private Employee inputUser;//录入人

    private Employee auditor; //审核人

    private Supplier supplier;//供应商

    private Depot depot;//仓库

    //包含的采购明细
    private List<OrderBillItem> items = new ArrayList<>();
}
